﻿using System;

class OutputMatrix
{
    static void Main()
    {
        /*Write a program that reads from the console a positive integer number N (N < 20) and 
         * outputs a matrix like the following:       N = 3			N = 4   */

        int n = int.Parse(Console.ReadLine());
        if (0 < n && n < 20)
        {
            for (int i = 1; i <= n; i++)
            {
                Console.Write(i + " ");
                for (int j = i + 1; j <= i + n - 1; j++)
                {
                    Console.Write(j + " ");
                }
                Console.WriteLine();
            }
        }        
    }
}

